package com.sinosoft.cpyy.config.interceptor;

import com.sinosoft.cpyy.config.interceptor.exam.ExamInterceptor;
import com.sinosoft.cpyy.config.interceptor.user.AdminInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 创建时间：2018/三月/27
 *
 * @author 张政[zhang_zheng@sinosoft.com.cn]
 * 类名：InterceptorConfig
 * 描述：配置拦截器
 */
@Configuration
public class InterceptorConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new AdminInterceptor()).addPathPatterns("/admin/*");
        registry.addInterceptor(new ExamInterceptor()).addPathPatterns("/exam/*");
        super.addInterceptors(registry);
    }
}
